home *** CD-ROM | disk | FTP | other *** search
- Path: erich.triumf.ca!bennett
- From: bennett@erich.triumf.ca (P.Bennett)
- Newsgroups: comp.lang.c
- Subject: Re: Problem with ascii to number conversion.
- Date: 20 Jan 1996 09:56 PST
- Organization: TRIUMF: Tri-University Meson Facility
- Distribution: world
- Message-ID: <20JAN199609563071@erich.triumf.ca>
- References: <96012012081730705@busilink.com>
- NNTP-Posting-Host: ftp.triumf.ca
- News-Software: VAX/VMS VNEWS 1.50
-
- In article <96012012081730705@busilink.com>, paul.kelley@busilink.com (Paul Kelley) writes...
- >Hi,
- > i am a beginner c programmer, stuck on what i thought was a simple
- >problem. I have an ascii input file that contains payroll info for a
- >month, the data is monetary values as ascii strings. I am trying to
- >convert the ascii ti numbers total the result then place in another
- >file. I am using micrsoft quick C and the ascii to number functions in
- >it. Apparenntly these functions only work correctly up to four digits.
- >After that teh ouput goes wild.
-
- A widely used commercial product like Micro$oft, unlikely to have this sort of
- a bug, so it is probably your program. The problem would be easier to resolve
- if you had showed some source code.
-
- However, "4 digits" sounds suspiciously like the size of a pointer in some
- memory models...
-
- If you area reading the numbers from the file with fscanf(), remember that
- fscanf() requires the _address_ of a variable, like:
- float f;
- fscanf(file, "%f", &f);
-
- Peter Bennett VE7CEI | Vessels shall be deemed to be in sight
- Internet: bennett@triumf.ca | of one another only when one can be
- Packet: ve7cei@ve7kit.#vanc.bc.ca | observed visually from the other
- TRIUMF, Vancouver, B.C., Canada | ColRegs 3(k)
- GPS and NMEA info and programs: ftp://sundae.triumf.ca/pub/peter/index.html
-
-
-
-
-
-